package com.jason.sms.agent.util;

/**
 * 号码类型
 */
public enum PhoneNumberType {
    //CDMA-CDMA2000
    //CMCC-中国移动
    //PHS-中国电信小灵通
    //CU-中国联通号码
    //OTHERS-其他无法判断的号码
    CDMA(1), CMCC(2), CU(3), PHS(4), OTHERS(0);
    private int type;

    private PhoneNumberType(int type) {
        this.type = type;
    }

    /**
     * 获取整型表示
     *
     * @return
     */
    public int getValue() {
        return type;
    }

    public static PhoneNumberType getType(int i) {
        switch (i) {
            case 1://CMDA
                return PhoneNumberType.CDMA;
            case 2://CMCC
                return PhoneNumberType.CMCC;
            case 3://CU
                return PhoneNumberType.CU;
            case 4://PHS
                return PhoneNumberType.PHS;
            default://OTHERS
                return PhoneNumberType.OTHERS;
        }
    }
}
